<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../依赖包/react.development.js"></script>
  <script src="../依赖包/react-dom.development.js"></script>
  <script src="../依赖包/babel.min.js"></script>
</head>

<body>
  <h1>课程列表</h1>
  <ul id='ul'>

  </ul>


  <script type="text/babel">
    const courses = [
      { id: 1, name: 'React' },
      { id: 3, name: 'Vue' },
      { id: 5, name: '小程序' },
      { id: 6, name: 'xxx' }
    ]

    const lis = courses.map(item => {
      return <li key={item.id}>{item.name}</li>
    }

    )
    console.log(lis)


    const vDom = (
      <div>
        {lis}
      </div>
    )

    ReactDOM.render(vDom, document.querySelector('#ul'))

  </script>
</body>

</html>